<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <link rel="shortcut icon" href="../../static/favicon.ico" th:href="@{/favicon.ico}"/>

    <title>Client Details . OAuth2-Shiro[authz]</title>

    <th:block th:include="fragments/main::header-css"/>
    <style>
        .list-group li:hover {
            background-color: #f9f9f9;
        }
    </style>
</head>
<body>
<div class="container">
    <a href="../" th:href="@{/}">Home</a>

    <h2>Client Details</h2>

    <div class="pull-right">
        <a href="client_details/form/plus" class="btn btn-success">Add Client</a>
    </div>
    <form action="" class="form-inline">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="Type clientId" name="clientId"
                   th:value="${listDto.clientId}"/>
        </div>
        <button type="submit" class="btn btn-default">Search</button>
        &nbsp;<span class="text-info">Total: [[${listDto.size}]]</span>
    </form>
    <br/>

    <div>
        <ul class="list-group">
<!--            <c:if test="${empty listDto.clientDetailsDtos}">-->
                <li class="list-group-item" th:if="${listDto.clientDetailsDtos.isEmpty()}">
                    <p>Empty result</p>
                </li>
<!--            </c:if>-->
<!--            <c:forEach items="${listDto.clientDetailsDtos}" var="cli">-->
                <li class="list-group-item" th:each="cli : ${listDto.clientDetailsDtos}">
                    <div class="pull-right">
                        <span th:if="${not cli.archived}">
                            <a th:href="@{'/client_details/test_client/'+${cli.clientId}}">test</a>
                        </span>
                        <span th:if="${cli.archived}"><strong class="text-muted">Archived</strong></span>
                    </div>
                    <h3 class="list-group-item-heading">
                        [[${cli.clientName}]]
                        <small>[[${cli.grantTypes}]]</small>
                    </h3>

                    <div class="list-group-item-text text-muted">
                        client_id: <span class="text-danger" th:text="${cli.clientId}"></span>&nbsp;
                        client_secret: <span class="text-primary" th:text="${cli.clientSecret}"></span>&nbsp;
                        <br/>
                        grant_types: <span class="text-primary" th:text="${cli.grantTypes}"></span>&nbsp;
                        resource_ids: <span class="text-primary" th:text="${cli.resourceIds}"></span>&nbsp;
                        <br/>
                        scope: <span class="text-primary" th:text="${cli.scope}"></span>&nbsp;
                        redirect_uri: <span class="text-primary" th:text="${cli.redirectUri}"></span>&nbsp;
                        <br/>
                        roles: <span class="text-primary" th:text="${cli.roles}"></span>&nbsp;
                        access_token_validity: <span class="text-primary" th:text="${cli.accessTokenValidity}"></span>&nbsp;
                        refresh_token_validity: <span class="text-primary" th:text="${cli.refreshTokenValidity}"></span>&nbsp;
                        <br/>
                        client_uri: <span class="text-primary" th:text="${cli.clientUri}"></span>&nbsp;
                        client_icon_uri: <span class="text-primary" th:text="${cli.clientIconUri}"></span>&nbsp;
                        <br/>
                        create_time: <span class="text-primary" th:text="${cli.createTime}"></span>&nbsp;
                        archived: <strong th:class="${cli.archived?'text-warning':'text-primary'}" th:text="${cli.archived}"></strong>&nbsp;
                        trusted: <span class="text-primary" th:text="${cli.trusted}"></span>&nbsp;
                        description: <span class="text-primary" th:text="${cli.description}"></span>&nbsp;
                    </div>
                </li>
<!--            </c:forEach>-->

        </ul>
        <p class="help-block">
            每一个item对应<code>oauth_client_details</code>表中的一条数据; 共<strong>[[${listDto.size}]]</strong>条数据.
        </p>
    </div>

    <div th:replace="fragments/main :: footer"/>
</div>
</body>
</html>